<?php /*a:2:{s:79:"D:\phpstudy_pro\WWW\www.xnadmin.site\app\admin\view\data_content_grab\form.html";i:1618830221;s:63:"D:\phpstudy_pro\WWW\www.xnadmin.site\app\admin\view\iframe.html";i:1588058566;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title><?php echo xn_cfg('base.sys_name'); ?></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script>
        //全局上传文件端口
        var UPLOAD_FILE_URL = "<?php echo url('upload_files/upload'); ?>";
        //全局选择文件端口
        var SELECT_FILE_URL = "<?php echo url('upload_files/select'); ?>";
    </script>
    <script src="/static/admin/js/jquery-2.0.0.min.js"></script>
    <script src="/static/admin/js/common.js"></script>
    <script src="/static/admin/js/upload.js"></script>
    <script src="/static/admin/js/webuploader.min.js"></script>
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/style/base.css" media="all">
    
    <style>
        .h15{height: 15px;}
    </style>
</head>
<body>
<div class="h15"></div>

<style>
    .layui-form-select{
        z-index: 1000;
    }
</style>
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form action="<?php echo request()->url(); ?>" method="post" class="xn_ajax2" data-type="open">
        <div class="layui-form-item">
            <label class="layui-form-label">行业类型</label>
            <div class="layui-input-inline">
                <select name="parent_typeid" lay-filter="parent_typeid">
                    <option value="0">选择类型</option>
                    <?php if(is_array($parent_typelist) || $parent_typelist instanceof \think\Collection || $parent_typelist instanceof \think\Paginator): if( count($parent_typelist)==0 ) : echo "" ;else: foreach($parent_typelist as $key=>$vo): ?>
                    <option value="<?php echo htmlentities($vo['id']); ?>" <?php if($data['parent_typeid'] == $vo['id']): ?>selected<?php endif; ?> ><?php echo htmlentities($vo['title']); ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="typeid" id="typeid">
                    <option value="0">选择类型</option>
                    <?php if(is_array($typelist) || $typelist instanceof \think\Collection || $typelist instanceof \think\Paginator): if( count($typelist)==0 ) : echo "" ;else: foreach($typelist as $key=>$vo): ?>
                    <option value="<?php echo htmlentities($vo['id']); ?>" <?php if($data['typeid'] == $vo['id']): ?>selected<?php endif; ?> ><?php echo htmlentities($vo['title']); ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data['title']); ?>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
                <input type="text" name="post[keywords]" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data['post']['keywords']); ?>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">简介</label>
            <div class="layui-input-block">
                <textarea name="post[description]" class="layui-textarea"><?php echo htmlentities($data['post']['description']); ?></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属项目</label>
            <div class="layui-input-block">
                <input type="text" name="project" placeholder="" autocomplete="off" class="layui-input" value="<?php echo htmlentities($data['project']); ?>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">属性</label>
            <div class="layui-input-block">
                <?php if(is_array($attrlist) || $attrlist instanceof \think\Collection || $attrlist instanceof \think\Paginator): if( count($attrlist)==0 ) : echo "" ;else: foreach($attrlist as $key=>$vo): ?>
                <input type="checkbox" name="post[attr_ids][]" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vo['title']); ?>" <?php if(in_array($vo['id'],$data['post']['attr_ids'])): ?>checked<?php endif; ?>><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span><?php echo htmlentities($vo['title']); ?></span><i class="layui-icon layui-icon-ok"></i></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">人群</label>
            <div class="layui-input-block">
                <?php if(is_array($crowdlist) || $crowdlist instanceof \think\Collection || $crowdlist instanceof \think\Paginator): if( count($crowdlist)==0 ) : echo "" ;else: foreach($crowdlist as $key=>$vo): ?>
                <input type="checkbox" name="post[crowd_ids][]" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vo['title']); ?>" <?php if(in_array($vo['id'],$data['post']['crowd_ids'])): ?>checked<?php endif; ?>><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span><?php echo htmlentities($vo['title']); ?></span><i class="layui-icon layui-icon-ok"></i></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">投资金额</label>
            <div class="layui-input-block">
                <?php if(is_array($amountlist) || $amountlist instanceof \think\Collection || $amountlist instanceof \think\Paginator): if( count($amountlist)==0 ) : echo "" ;else: foreach($amountlist as $key=>$vo): ?>
                <input type="checkbox" name="post[amount_ids][]" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vo['title']); ?>" <?php if(in_array($vo['id'],$data['post']['amount_ids'])): ?>checked<?php endif; ?>><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span><?php echo htmlentities($vo['title']); ?></span><i class="layui-icon layui-icon-ok"></i></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选址</label>
            <div class="layui-input-block">
                <?php if(is_array($regionlist) || $regionlist instanceof \think\Collection || $regionlist instanceof \think\Paginator): if( count($regionlist)==0 ) : echo "" ;else: foreach($regionlist as $key=>$vo): ?>
                <input type="checkbox" name="post[region_ids][]" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vo['title']); ?>" <?php if(in_array($vo['id'],$data['post']['region_ids'])): ?>checked<?php endif; ?>><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span><?php echo htmlentities($vo['title']); ?></span><i class="layui-icon layui-icon-ok"></i></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">经营</label>
            <div class="layui-input-block">
                <?php if(is_array($operatelist) || $operatelist instanceof \think\Collection || $operatelist instanceof \think\Paginator): if( count($operatelist)==0 ) : echo "" ;else: foreach($operatelist as $key=>$vo): ?>
                <input type="checkbox" name="post[operate_ids][]" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary" title="<?php echo htmlentities($vo['title']); ?>" <?php if(in_array($vo['id'],$data['post']['operate_ids'])): ?>checked<?php endif; ?>><div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span><?php echo htmlentities($vo['title']); ?></span><i class="layui-icon layui-icon-ok"></i></div>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-block">
                <textarea name="post[content]" id="content"><?php echo htmlentities($data['post']['content']); ?></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" lay-submit class="layui-btn">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>


<script src="/static/admin/layui/layui.all.js"></script>
<script src="/static/admin/js/admin.js"></script>

<!--编辑器-->
<script src="/static/admin/ueditor/ueditor.config.js"></script>
<script src="/static/admin/ueditor/ueditor.all.min.js"></script>
<script src="/static/admin/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    UE.getEditor('content',{
        initialFrameWidth :660,// 设置编辑器宽度
        initialFrameHeight:400,// 设置编辑器高度
        scaleEnabled:true
    });

    var form = layui.form;
    form.on('select(parent_typeid)', function(res) { 
        $("#typeid").empty();
        if(res.value != 0){
            $.get("<?php echo url('admin/DataType/getSonType'); ?>?pid="+res.value,function(result){
                if(result.status){
                    $("#typeid").append(new Option('请选择',0));
                    $.each(result.data,function(index,item){
                        $("#typeid").append(new Option(item.title,item.id));
                    });
                    form.render("select");
                }
            });
        }else{
            $("#typeid").append(new Option('请选择',0));
            form.render("select");
        }
    })
</script>

</body>
</html>